<template>
  <div>
    <h1>{{fullName}}</h1>
    <button @click="changeFullName">修改</button>
  </div>
</template>

<script lang="ts">
  import {defineComponent} from "vue"
  export default defineComponent({
    name:'Abort',
  })


</script>
<script setup lang="ts">
import {ref,computed} from "vue"
let firstName = ref('高')
let lastName = ref('雅琳')

const fullName = computed({
    get(){
      return firstName.value + ' ' +lastName.value
    },
    set(val){  
        firstName.value = val.split(' ')[0]
        lastName.value = val.split(' ')[1]
    },

})
console.log(fullName)
const changeFullName = ()=>{
    fullName.value = '李 沛华'
}


</script>